package clienteWS;

import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.Service;


@WebServiceClient(name = "EjemploWSService", 
                  wsdlLocation = "http://localhost:8080/Ejemplo_WS_SOAP/EjemploWS?wsdl",
                  targetNamespace = "http://ws/") 
public class EjemploWSService extends Service {

    public final static URL WSDL_LOCATION;

    public final static QName SERVICE = new QName("http://ws/", "EjemploWSService");
    public final static QName EjemploWSPort = new QName("http://ws/", "EjemploWSPort");
    static {
        URL url = null;
        try {
            url = new URL("http://localhost:8080/Ejemplo_WS_SOAP/EjemploWS?wsdl");
        } catch (MalformedURLException e) {
            java.util.logging.Logger.getLogger(EjemploWSService.class.getName())
                .log(java.util.logging.Level.INFO, 
                     "Can not initialize the default wsdl from {0}", "http://localhost:8080/Ejemplo_WS_SOAP/EjemploWS?wsdl");
        }
        WSDL_LOCATION = url;
    }

    public EjemploWSService(URL wsdlLocation) {
        super(wsdlLocation, SERVICE);
    }

    public EjemploWSService(URL wsdlLocation, QName serviceName) {
        super(wsdlLocation, serviceName);
    }

    public EjemploWSService() {
        super(WSDL_LOCATION, SERVICE);
    }
    
    //This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2
    //API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1
    //compliant code instead.
    public EjemploWSService(WebServiceFeature ... features) {
        super(WSDL_LOCATION, SERVICE, features);
    }

    //This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2
    //API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1
    //compliant code instead.
    public EjemploWSService(URL wsdlLocation, WebServiceFeature ... features) {
        super(wsdlLocation, SERVICE, features);
    }

    //This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2
    //API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1
    //compliant code instead.
    public EjemploWSService(URL wsdlLocation, QName serviceName, WebServiceFeature ... features) {
        super(wsdlLocation, serviceName, features);
    }


    @WebEndpoint(name = "EjemploWSPort")
    public EjemploWS getEjemploWSPort() {
        return super.getPort(EjemploWSPort, EjemploWS.class);
    }


    @WebEndpoint(name = "EjemploWSPort")
    public EjemploWS getEjemploWSPort(WebServiceFeature... features) {
        return super.getPort(EjemploWSPort, EjemploWS.class, features);
    }

}
